import { LOADDATA } from "./actionTypes";

import { get } from "@u/http";

const loadDataSync = list =>{
  console.log("背对背",list);
   return { 
     type: LOADDATA,
     list
   }
}

const loadDataAsync = () =>{
     return  async dispatch => {
     let result = await get({
       url:'./api/list'
     })
       dispatch(loadDataSync(result.data.data))
      }
}

export {
  loadDataSync,
  loadDataAsync
}